/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.webshop.backend.dbahif;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.HashMap;

/**
 *
 * @author Martin Haubenwallner
 */
public class AdvancedConnection {

    private Connection con;
    private HashMap<String, PreparedStatement> preparedStatements;

    public AdvancedConnection(Connection con) {
        preparedStatements = new HashMap<String, PreparedStatement>();
        this.con = con;
    }

    public PreparedStatement getPreparedStatement(String key) {
        return preparedStatements.get(key);
    }

    public void setPreparedStatement(String key, PreparedStatement statement)
    {
        preparedStatements.put(key, statement);
    }

    public boolean containsStatement(String key) {
        return preparedStatements.containsKey(key);
    }

    public Connection getConnection() {
        return con;
    }
}
